package com.audaque.springboot.foshanupload.web.webdemo.controller;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.tree.Tree;
import cn.hutool.core.lang.tree.TreeNode;
import cn.hutool.core.lang.tree.TreeUtil;
import cn.hutool.core.net.url.UrlBuilder;
import com.audaque.springboot.foshanupload.log.anno.WebLogAnno;
import com.audaque.springboot.foshanupload.web.anno.RAnno;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author zgb
 * @desc ...
 * @date 2023-06-05 21:09:52
 */

@Slf4j
@RestController
@RequestMapping("hutoolUrlBuilder")
public class HutoolUrlBuilderController {


    @RAnno
    @WebLogAnno
    @GetMapping("/buildUrl")
    public void buildUrl(  ) throws Exception {
        String buildUrl = UrlBuilder.create()
                .setScheme("https")
                .setHost("www.hutool.cn")
                .addPath("/aaa").addPath("bbb")
                .addQuery("ie", "UTF-8")
                .addQuery("wd", "test")
                .addPathSegment("/ccc")
                .build();
        //buildUrl:https://www.hutool.cn/aaa/bbb/ccc?ie=UTF-8&wd=test
        log.debug("buildUrl:"+buildUrl);
    }


}
